package com.vcourse.service.edu.controller.api;

import com.vcourse.commons.result.R;
import com.vcourse.service.edu.service.SubjectService;
import com.vcourse.service.edu.vo.SubjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Zengsh123
 * @date 2020-06-07 13:50
 */
@Api("课程分类")
@Slf4j
@RestController
@RequestMapping("/api/edu/subject")
public class ApiSubjectController {
    @Resource
    private SubjectService subjectService;

    @ApiOperation("嵌套数据列表")
    @GetMapping("nestedList")
    public R nestedList(){
        List<SubjectVo> subjectVoList = subjectService.nestedList();
        return R.ok().data(subjectVoList);
    }
}
